package com.itlong.cloud.app.dao;

import com.itlong.cloud.POJO.DTO.app.AppElevatorAuthDTO;
import com.itlong.cloud.POJO.PO.DeviceCloudIntercomInfoPO;
import com.itlong.cloud.POJO.PO.DeviceElevatorInfoPO;
import com.itlong.cloud.POJO.PO.DeviceEntranceInfoPO;
import com.itlong.cloud.POJO.PO.ProjectPO;
import com.itlong.cloud.POJO.VO.app.old.AppOldDeviceServeRoomVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      旧版APP的首页数据访问接口
 * </desc>
 *
 * @createDate 2017/11/1
 */

@Mapper
@Repository
public interface IAppOldHomeDao {

    /**
     * <desc>
     *     旧版APP_首页查询推送信息
     * </desc>
     * @param pushparam
     * @return
     */
    Map<String,Object> getPushInfo(Map<String,Object> pushparam);


    /**
     * <desc>
     *     旧版APP_首页查询广告信息
     * </desc>
     * @param adparam
     * @return
     */
    List<Map<String,Object>> getAdInfo(Map<String,Object> adparam);

    /**
     * <desc>
     *      获取用户拥有的项目列表
     * </desc>
     *
     * @param userId
     * @return
     * @author Jiaqi.X
     * @createDate 2018/01/12
     */
    public List<String> getUserProjectList(String userId);

    /**
     * <desc>
     *     旧版APP_首页查询广告的图片
     * </desc>
     * @param adId
     * @return
     */
    Map<String,Object> getAdImg(@Param("adId") String adId);

    /**
     * <desc>
     *      查询用户的项目id集合
     * </desc>
     *
     * @param userId 用户id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/12/28
     */
    List<String> getUserProjectIds(@Param("userId") String userId);

    /**
     * <desc>
     *     旧版APP_查询用户
     * </desc>
     * @param projectparam
     * @return
     */
    List<Map<String,Object>> getUserProject(Map<String,Object> projectparam);


    /**
     * <desc>
     *     旧版APP_查询用户门禁权限
     * </desc>
     * @param deviceauthmap
     * @return
     */
    List<Map<String,Object>> getUserDoorList(Map<String,Object> deviceauthmap);

    /**
     * <desc>
     *     旧版APP_过滤用户的门禁权限
     * </desc>
     * @param entranceIdList
     * @return
     */
    List<DeviceEntranceInfoPO> getUserEntranceList(@Param("entranceIdList") List<String> entranceIdList,@Param("projectId") String projectId);

    /**
     * <desc>
     *     旧版APP_查询用户云对讲权限
     * </desc>
     * @param deviceauthmap
     * @return
     */
    List<Map<String,Object>> getUserCloudDoorList(Map<String,Object> deviceauthmap);

    /**
     * <desc>
     *     旧版APP_过滤用户的云对讲权限
     * </desc>
     * @param cloudDoorIdList
     * @return
     */
    List<DeviceCloudIntercomInfoPO> getUserCloudIntercomDoorList(@Param("cloudDoorIdList") List<String> cloudDoorIdList,@Param("projectId") String projectId);

    /**
     *  <desc>
     *      旧版APP_用户有权限的云对讲设备服务的房间信息
     *  </desc>
     * @param roomparam
     * @return
     */
    List<AppOldDeviceServeRoomVO> getUserRoomInCloudDoorList(Map<String,Object> roomparam);

    /**
     * <desc>
     *     旧版APP_查询用户的电梯列表
     * </desc>
     * @param deviceauthmap
     * @return
     */
    List<AppElevatorAuthDTO> getUserFloorList(Map<String,Object> deviceauthmap);

    /**
     * <desc>
     *     旧版APP_过滤用户的电梯权限
     * </desc>
     * @param floorIdList
     * @return
     */
    List<DeviceElevatorInfoPO> getUserElevatorFloorList(@Param("floorIdList") List<String> floorIdList,@Param("projectId") String projectId);


    /**
     * <desc>
     *     旧版APP_根据设备的楼层标识查询楼层名称
     * </desc>
     * @param naturalFloorList
     * @return
     */
    String getLogicalFloor(@Param("naturalFloorList") List<String> naturalFloorList,@Param("deviceUnique")String deviceUnique);

    /**
     * <desc>
     *     根据设备的楼层标识查询真实楼层
     * </desc>
     * @param naturalFloorList
     * @return
     */
    String getFloorNum(@Param("naturalFloorList") List<String> naturalFloorList,@Param("deviceUnique")String deviceUnique);


    /**
     * <desc>
     *     根据项目编号查询项目信息
     * </desc>
     * @param projectId
     * @return
     */
    ProjectPO getProjectById(@Param("projectId") String projectId);

    /**
     * <desc>
     *     根据用户与项目编号查询带房间的邀请家人数量
     * </desc>
     * @param userId
     * @param projectId
     * @return
     */
    Integer countUserChild(@Param("userId") String userId,@Param("projectId") String projectId);




}
